package com.jhw.ymcc.exception;

import lombok.Getter;

/**
 * @BelongsProject: itsource-ymcc
 * @BelongsPackage: cn.itsource
 * @Author: Director
 * @CreateTime: 2022-08-07  16:32
 * @Description: 错误码封装
 * @Version: 1.0
 */
@Getter
public enum GlobalErrorCode {

    // 成功
    OK("0", "服务正常！"),
    COURSE_NOT_ON("课程微未上线", "10058"),
    COURSE_RELEASE_ERROR("课程发布失败", "10090"),
    COURSE_REMOVE_ERROR("课程下架失败", "10097"),
    COURSE_DOESNOTEXIST_ERROR("课程不能为空", "7894"),
    SERVICE_ERROR("服务gg", "0808"),
    REFER_CODE_ERROR("推荐码错误", "6969"),
    INTEGRAL_INSUFFICIENT_ERROR("积分不足", "686868"),
    // 失败
    ERROR("-1", "服务不可用，我们正在暴揍程序员，请稍后重试！"),
    COURSE_EXISTS_ERROR("请不要重复添加课程", "080"),
    // 100xx公共异常
    SERVICE_PARAM_IS_NULL("10000", "参数不能为空！"),
    COURSETYPE_NOT_NULL_ERROR("课程类型不能为空", "10090"),
    OPERATING_FREQUENTLY_ERROR("请勿重复操作！", "10002"),

    USER_SAVE_ERROR("用户保存错误", "50006"),

    CODE_ERROR("短信验证码错误", "5004"),
    // system的异常以200XX打头
    USER_EXISTED_ERROR("用户已经存在", "50005"),
    // user的异常以300XX打头
    CODE_IS_NULL_ERROR("短信验证码为空！", "50003"),
    // uaa的异常以400XX打头
    CODE_EXPIRED_ERROR("代码过期了", "50002"),
    // 黑名单
    DUPLICATE_ADDITION_ERROR("40007","用户已在黑名单，请勿重复提交"),
    // common的异常以500XX打头
    PHONE_FORMAT_ERROR("手机号格式不合法！", "50001");
    ;

    private String message;

    private String code;

    GlobalErrorCode(String message, String code) {
        this.message = message;
        this.code = code;
    }


}
